/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.agentslab.gameprovider;

import aa.core.ActorMessage;
import aa.core.ActorName;
import aa.core.Contract;
import aa.core.CyberOrg;
import aa.core.Platform;
import aa.drivers.driver;
import aa.gui.View;
import aa.tool.CyberOrgTuple;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author mehadihasan
 */
public class GameProviderMain {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        //final String brokerHost = "10.225.160.74";//"192.168.1.105";

        Integer iPort = new Integer(8070);

        View myView = new View(iPort);

        Platform myPlatform = new Platform(myView,iPort);

        myPlatform.start();

        Object[] objaAgs = new Object[0];

        Object[] objaFaci = {new Long(0)};
        ActorName resourceBroker = new ActorName("10.225.192.93", 6);


        CyberOrg cyb = (CyberOrg)myPlatform.createCyberOrg(new Long(90000000),new Long(90000),new Long(1000),"aa.core.FacilitatorActor",objaAgs);
        
        ActorName gameProvider = myPlatform.createActor(cyb.getFacilitator(), "aa.core.Actor", objaAgs);
        Object[] argsreg=new Object[2];
        argsreg[0]= new Contract(1000000,1000,1);
        argsreg[1]= "pacman";
        try {
            Thread.sleep(1000);
        } catch (InterruptedException ex) {
            ex.printStackTrace();
        }

        ActorMessage am_reg = new ActorMessage(myPlatform.getActorNameOfPlatform(),
                                               resourceBroker,
                                               "getNewResource",
                                               argsreg,
                                               false
                                               );

        myPlatform.sendMessage(am_reg);


    }

}
